<template>
  <div class="school">
    <h2 @click="showName">学校姓名：{{ name | mySlice }}</h2>
    <h2>学校地址：{{ address }}</h2>
    <button @click="test">测试hello方法</button><br><br>
    <button @click="sendSchoolName(name)">把学校名给App</button>
    <!--  以下写法也行  -->
    <!--    <button @click="hello">测试hello方法</button>-->
  </div>
</template>

<script>
// 局部混合
import {showName} from "@/mixins";

export default {
  name: "School",
  data() {
    return {
      name: "ABC12312321",
      address: "深圳",
    }
  },
  methods: {
    test(e) {
      this.hello();
    },
    sendSchoolName(name){
      this.appGetSchoolName(name);
    }
  },
  computed: {},
  components: {},
  mixins: [showName],
  watch: {},
  filters: {},
  directives: {},
  props:['appGetSchoolName']
}
</script>

<style scoped>
.school {
  background-color: skyblue;
  padding: 5px;
}
</style>